<template>
  <div class="container">
    <el-dialog title="分货单详情" :visible.sync="dialog.centerDialogVisible" @open="getData" center>
      <el-table :data="tableData" border style="width: 100%" empty-text="暂无数据">
        <el-table-column prop="ord_name" label="店铺名"  align="center"></el-table-column>
      <el-table-column prop="money" label="分货总价"  align="center"></el-table-column>
      <el-table-column prop="price" label="分货单价"  align="center"></el-table-column>
      <el-table-column prop="qty" label="数量" align="center"></el-table-column>
      <el-table-column prop="unit" label="单位" align="center"></el-table-column>
       <el-table-column prop="purchase_price" label="采购单价" align="center"></el-table-column>
      <el-table-column prop="purchase_money" label="采购总价" align="center"></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { findCargoInfo } from "@/api/sortGoods/sortGoodsList";
export default {
  props: {
    dialog: Object
  },
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    confirm() {
      this.dialog.centerDialogVisible = false;
    },
    getData() {
      let data = {
        id: this.dialog.id
      };
      findCargoInfo(data).then(res => {
        if (res.code == 0) {
            this.tableData = res.data.info.store_goods;
        }
      });
    },
    //每页多少条
    handleCurrentChange(val) {
      this.pageData.page = 1;
      this.pageData.pageSize = val;
      this.getData();
    },
    //选取页数
    handleSizeChange(page) {
      this.pageData.page = page;
      this.getData();
    }
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
}
</style>